# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-confection
pkgver=0.1.4
pkgrel=0
pkgdesc="Confection: the sweetest config system for Python"
url="https://github.com/explosion/confection"
arch="noarch"
license="MIT"
depends="
	python3
	py3-pydantic
	py3-srsly
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-doc $pkgname-pyc"
checkdepends="
	py3-catalogue
	py3-pytest-runner
	py3-pytest-xdist
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/explosion/confection/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/confection-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python -m installer -d "$pkgdir" .dist/*.whl

	install -vDm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/confection/tests
}

sha512sums="
abb9155ed29e4f92d9128ba74c7dc63153416e397ef7f1b6f6dd6cfb00fc8649f2ebe35deff29c4fe86708daa8d8582d25f7846ff195aaba5afd6fbb5f8e91f6  py3-confection-0.1.4.tar.gz
"
